import {reactive} from "vue";
import {semesterValidator} from '@/validator/validator'

export const experimentAddTableColumns = [
    {
        title: '学期',
        key: 'semesterName',
        dataIndex: 'semesterName',
    },
    {
        title:'课程',
        key:'courseName',
        dataIndex:'courseName'
    },
    {
        title:'实验室类型',
        key:'labTypeName',
        dataIndex:'labTypeName',
    },
    {
        title:'班级',
        key:'classname',
        dataIndex:'classname',
    },
    {
        title:'学生人数',
        key:'studentCount',
        dataIndex:'studentCount',
    },
    {
        title:'起始周',
        key:'startWeek',
        dataIndex:'startWeek',
    },
    {
        title:'结束周',
        key:'endWeek',
        dataIndex:'endWeek',
    },
    {
        title:'节次',
        key:'sectionName',
        dataIndex:'sectionName',
    },
    {
        title:'上课时间',
        key:'weekdayName',
        dataIndex:'weekdayName',
    },
    {
        title:'状态',
        key:'status',
        dataIndex:'status',
    },
    {
        title: '操作',
        key: 'action',
    },

];


/*
    弹窗表单字段
    rules:[{ type: 'email' }]***[{ required: true }]****[{ type: 'number', min: 0, max: 99 }]
    imputType:input****input-number****textarea
 */

const formFields =reactive( [
    {
        title:"学期",
        key: 'semesterId',
        rules: [{ required: true }],
        inputType: 'select',
        selectList:[]
    },
    {
        title: "课程",
        key: 'courseName',
        rules: [{ required: true }],
        inputType: 'input'
    },
    {
        title: "实验室类型",
        key: 'labType',
        rules: [{ required: true }],
        inputType: 'select',
        selectList:[]
    },
    {
        title: "班级",
        key: 'classname',
        rules: [{ required: true }],
        inputType: 'input'
    },
    {
        title: "学生人数",
        key: 'studentCount',
        rules: [{ required: true },{ type: 'number', min: 0}],
        inputType: 'input-number'
    },
    {
        title: "起始周",
        key: 'startWeek',
        rules: [{ required: true },{ type: 'number', min: 1 ,max:21}],
        inputType: 'input-number'
    },
    {
        title: "结束周",
        key: 'endWeek',
        rules: [{ required: true },{ type: 'number', min: 1 ,max:21}],
        inputType: 'input-number'
    },
    {
        title: "节次",
        key: 'section',
        rules: [{ required: true }],
        inputType: 'select',
        selectList:[]
    },
    {
        title: "上课时间",
        key: 'weekday',
        rules: [{ required: true }],
        inputType: 'select',
        selectList:[]
    }]);


const searchFormFields =reactive( [
    {
        title:"学期",
        key: 'semesterId',
        rules: [{ required: false }],
        inputType: 'select',
        selectList:[]
    },
    {
        title: "课程",
        key: 'courseName',
        rules: [{ required: false }],
        inputType: 'input'
    },
    {
        title: "实验室类型",
        key: 'labType',
        rules: [{ required: false }],
        inputType: 'select',
        selectList:[]
    },
    {
        title: "班级",
        key: 'classname',
        rules: [{ required: false }],
        inputType: 'input'
    },
    {
        title: "学生人数",
        key: 'studentCount',
        rules: [{ required: false },{ type: 'number', min: 0}],
        inputType: 'input-number'
    },
    {
        title: "起始周",
        key: 'startWeek',
        rules: [{ required: false },{ type: 'number', min: 1 ,max:21}],
        inputType: 'input-number'
    },
    {
        title: "结束周",
        key: 'endWeek',
        rules: [{ required: false },{ type: 'number', min: 1 ,max:21}],
        inputType: 'input-number'
    },
    {
        title: "节次",
        key: 'section',
        rules: [{ required: false }],
        inputType: 'select',
        selectList:[]
    },
    {
        title: "上课时间",
        key: 'weekday',
        rules: [{ required: false }],
        inputType: 'select',
        selectList:[]
    },
    {
        title: "状态",
        key: 'status',
        rules: [{ required: false }],
        inputType: 'select',
        selectList:[
            {
                selectKey:"未排课",
                selectName:"未排课"
            },
            {
                selectKey:"已排课",
                selectName:"已排课"
            },
            {
                selectKey:"驳回",
                selectName:"驳回"
            }
        ]
    },
    ]);

export {formFields,searchFormFields}
